<?php 
$xmlfile="class.xml";
if(!$dom=simplexml_load_file($xmlfile)){
echo "error in loading $xmlfile";
}else{
echo "loaded $xmlfile<br>";
}

function process_class($node)
{
}


function process_node($node,$path)
{
    $root = $path . "/" . $node->getName() ; 
    echo "$root" . "<br>";
    foreach($node->attributes() as $k=>$v){
        echo "$k" . "=" . $v . "<br>"; 
    }
    foreach($node->children() as $sub){
        process_node($sub,$root);
    }
}

function get_node($dom,$path)
{
    
}

function add_link($path,$name,$link)
{
    
}

foreach($dom->children() as $class) {
    process_node($class, "."); 
} 

?>
